import request from '@/config/axios'

export function getAllMilestoneApi() {
	return request.get<GMilestone[][]>({
		url: '/game/g-milestone/readOnly/getAllMilestone'
	})
}

export function getAllItemApi() {
	return request.get<GItem[]>({
		url: '/game/g-milestone/readOnly/getAllItem'
	})
}

export function getAllBuildingApi() {
	return request.get<GBuilding[]>({
		url: '/game/g-milestone/readOnly/getAllBuilding'
	})
}

export function getAllRecipeApi() {
	return request.get<GRecipe[]>({
		url: '/game/g-milestone/readOnly/getAllRecipe'
	})
}

export function getRecipeDetailByIdApi(recipeId: number) {
	return request.get<SearchRecipeVo>({
		url: '/game/g-milestone/readOnly/getRecipeDetailById/' + recipeId
	})
}

export function saveMilestoneApi(data: SaveMilestoneRequest) {
	return request.post({
		url: '/game/g-milestone/saveMilestone',
		data
	})
}

export function getAllMilestoneRequirementByMilestoneIdApi(milestoneId: number) {
	return request.get<GMilestoneRequirement[]>({
		url: '/game/g-milestone/readOnly/getAllMilestoneRequirementByMilestoneId/' + milestoneId
	})
}

export function getAllMilestoneUnlockByMilestoneIdApi(milestoneId: number) {
	return request.get<GMilestoneUnlock[]>({
		url: '/game/g-milestone/readOnly/getAllMilestoneUnlockByMilestoneId/' + milestoneId
	})
}

export function deleteMilestoneApi(id: number) {
	return request.delete({
		url: '/game/g-milestone/deleteMilestone/' + id
	})
}

export function getAllMilestoneRequirementVoByMilestoneIdApi(milestoneId: number) {
	return request.get<MilestoneRequirementVo[]>({
		url: '/game/g-milestone/readOnly/getAllMilestoneRequirementVoByMilestoneId/' + milestoneId
	})
}

export function getAllMilestoneUnlockVoByMilestoneIdApi(milestoneId: number) {
	return request.get<MilestoneUnlockVo[]>({
		url: '/game/g-milestone/readOnly/getAllMilestoneUnlockVoByMilestoneId/' + milestoneId
	})
}
